//
//  VHBaseNavigationController.m
//  FruitHelper
//
//  Created by 赵隆杰 on 2021/12/10.
//

#import "VHBaseNavigationController.h"

@interface VHBaseNavigationController ()

@end

@implementation VHBaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationBar.barTintColor = [UIColor whiteColor];
    self.navigationBar.tintColor = [UIColor blackColor];
    
    self.navigationBar.prefersLargeTitles = NO;
    self.navigationItem.largeTitleDisplayMode =  UINavigationItemLargeTitleDisplayModeNever;
    
}

/**
 能拦截所有push进来的子控制器
 */
-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    //    NSLog(@"pushViewController--%@",viewController);
    NSLog(@"%@ %lu",viewController,(unsigned long)self.viewControllers.count);
    //如果现在push的不是栈底控制器（最先push进来的那个控制器）
    if (self.viewControllers.count > 0) {
        
        viewController.hidesBottomBarWhenPushed = YES;
    } else {
        viewController.hidesBottomBarWhenPushed = NO;
        
    }
    [super pushViewController:viewController animated:animated];
}

@end
